package com.cxs.plan.mapper;

import com.cxs.plan.domain.entity.UserWithRole;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author Administrator
* @description 针对表【user_with_role(账号关联角色)】的数据库操作Mapper
* @createDate 2024-03-27 17:33:41
* @Entity com.cxs.plan.domain.entity.UserWithRole
*/
public interface UserWithRoleMapper extends BaseMapper<UserWithRole> {

    @Select("delete from user_with_role where user_id = #{userId}")
    void deleteByUserId(@Param("userId") Integer userId);

    void saveUserWithRole(@Param("userId") Integer id, @Param("roleIds") List<String> roleIds);

    @Select("select role_id from user_with_role where user_id = #{id}")
    List<String> getRoleIdsByUserId(Integer id);
}




